package org.fing.edu.uy.esbadp.validation;

import java.util.Collection;


public class ValidateArgument {
	
	/**
     * Validate the argument is not null.
     * @param arg Argument.
	 * @return boolean.
	 */
    public static boolean isNotNull(Object arg) {
        if(arg != null){
        	return true;
        }
        return false;
    }
    
    /**
	 * Validate the argument is not empty.
	 * @param arg Argument.
     * @return boolean.
     */
    public static boolean isNotEmpty(Object arg) {
        if(arg.toString().trim().length() > 0){
        	return true;
        }
        return false;
    }
	
    /**
     * Validate the argument is neither null nor empty.
     * @param arg Argument.
	 * @return boolean.
     */
    public static boolean isNotNullAndNotEmpty(Object arg) {
    	if((arg != null) && (arg.toString().trim().length() > 0)){
    		return true;
    	}
    	return false;
    }
    
    /**
     * Validate the argument is neither null nor empty.
     * @param arg Argument.
	 * @return boolean.
     */
    public static boolean isNotNullAndNotEmpty(@SuppressWarnings("rawtypes") Collection arg) {
    	if((arg != null) && (arg.size() > 0)){
    		return true;
    	}
    	return false;
    }
    
}
